<template>
	<view class="apps">
		<uv-swiper :list="info.images" v-if="info.images.length>0"></uv-swiper>
		<view class="title">
			<text>{{info.title}}</text>
		</view>
		<view class="content">
			<uv-parse :content="info.content" :tagStyle="style"></uv-parse>
		</view>
	</view>
	
</template>

<script>
	let app;
	import * as ww from '@wecom/jssdk'
	export default {
		data() {
			return {
				id:0,
				info:{
					title:'',
					conetnt:'',
					images:[],
				},
				style:{
					p:"font-size:15px;",
					img:"max-width:100%"
				}
			}
		},
		onLoad(opt){
			
			app = this;
			app.id = opt.id;
			ww.register({
				corpId: 'ww5d7b19c3c1ce8e1f',    // 必填，当前用户企业所属企业ID
				jsApiList: ['hideAllNonBaseMenuItem','hideOptionMenu','createWWLoginPanel'],  
				agentId:'1000007',
				getConfigSignature: async function(){
				  const configData = await app.request({
						url: '/auth',
						data:{'agent_id':''}
					})
					//app.alert(JSON.stringify(configData));
					return configData.data;
				},                
				getAgentConfigSignature: async function(){
					const AgentConf = await app.request({
						url: '/auth',
						data:{'agent_id':'1000007'}
					})
					//app.alert(JSON.stringify(AgentConf));
					return AgentConf.data;
				}
			})
			ww.hideAllNonBaseMenuItem();
			ww.hideOptionMenu();
			app.getDetail()
		},
		methods: {
			getDetail(){
				app.request({
					url:"/detail",
					data:{id:app.id},
					success:function(rlt){
						app.info = rlt.data;
					}
				})
			}
		}
	}
</script>

<style scoped>
	.title{padding:5px 10px;line-height: 28px;}
	.content{padding:5px;}
</style>
